<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>1.var-let-const</title>
</head>

<body>
  <!-- var和let const的区别 -->
  1.var是ES5语法，let const是ES6语法；var存在变量提升
  2.var 和 let是变量可修改；const是常量，不可修改
  3.let const有块级作用域，var没有
  4.var 定义的变量会挂载到window对象上，ES的语法(let const class)都不会


  <script>

    // ES5变量提升
    // console.log(a); // undefined
    var a = 200
    let b = 100
    console.log(window);

    // var a 
    // console.log(a);
    // a = 200





  </script>


</body>

</html>